/*
 * @Author: liuYang codkly@gmail.com
 * @Date: 2022-10-26 22:46:47
 * @LastEditors: lycodk lycodk@gmail.com
 * @LastEditTime: 2023-02-20 22:03:17
 * @FilePath: \coding\nest\blog_web\nuxt.config.ts
 * @Description:
 * 暂无备注
 */

const lifecycle = process.env.npm_lifecycle_event;
console.log(lifecycle)
let remove_console= []

if(process.env.NODE_ENV === 'production'){
    remove_console.push("transform-remove-console")
}
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
    app: {
        layoutTransition: { name: 'layout', mode: 'out-in' },
        pageTransition: { name: 'page', mode: 'out-in' },
        head: {
            htmlAttrs: {
                lang: "zh-CN",
            },
            titleTemplate: "%s - itliuyang.com",
            // title: "itliuyang.com",
            meta: [
                {name: "theme-color", content: "light"},
                {
                    name: "viewport",
                    content:
                        "width=device-width,initial-scale=1.0,maximum-scale=1.0,minimum-scale=1.0,user-scalable=no",
                },
                {
                    hid: "description",
                    name: "description",
                    content: "刘洋博客,主要用于摸摸鱼,写写日志,记录记录文章的一个nuxt网站",
                },
                {
                    hid: "keywords",
                    content: "刘洋博客,nuxt网站,nuxt3网站,vue网站,刘洋个人网站,刘洋网站",
                },
            ],
            link: [
                {rel: "icon", type: "image/x-icon", href: "/favicon.ico"}
            ],
            script: [
                {src: '/js/index.js'}
            ]
        },
    },
    // css
    css: ["~/assets/scss/index.css"],
    // postcss: {
    //     plugins: {
    //         tailwindcss: {},
    //         autoprefixer: {},
    //     },
    // },
    // 主题色
    colorMode: {
        classSuffix: "",
    },
    modules: [
        'nuxt-windicss',
        "@nuxtjs/color-mode",
        ["@pinia/nuxt", {disableVuex: true}]
    ],
    build: {
        transpile:
            lifecycle === "build" || lifecycle === "generate" ? ["element-plus"] : [],
    },
    experimental: {
        //nuxt3rc.12版本加载慢
        writeEarlyHints: false,
    },
    
    //
});
